#ifndef __MOTOR_H
#define __MOTOR_H	 
#include "delay.h"

#define LALMotor_IN1 PCout(14)
#define LALMotor_IN2 PCout(15)
#define LALMotor_AdjustInterval 1000
#define RevolverMotor_SpeedRoutine 100

extern int LeftHandle_Angle,LeftHandle_Distance;
extern u16 Default_Counter_Value;
extern u8 Flag_SpeedAdjust,Flag_LALMotorAdjust,Flag_Fire;
extern float e,e1,e2;
extern float duk,uk,uk1,out;
extern float Kp,Ki,Kd;
extern u16 SubMotor_PWMMax,SubMotor_PWMMin;
extern u16 RevolverMotor_TargetSpeed;
extern long RevolverMotor_RelativeCounter,RevolverMotor_CurrentSpeed;

void SubMotor_Init(u16 arr,u16 psc);
void SubMotor_Control(void);
u8 MainMotor_Control(void);
u16 PID_Speed_Calc(void);
void LALMotor_Run(void);
void LALMotor_Stop(void); 
void LALMotor_StatusUpdate(u8 Status);
void AcceMotor_StatusUpdate(void);

#endif
